import gzip
# 1.创建压缩文件
buf=b"this Lots of content here, 111, 222, 111, 222"
with gzip.open('test.gz','wb') as f:
    f.write(buf)
    
# 2.读取压缩文件
with gzip.open('test.gz','rb') as f:
    content=f.read()
    print(content)
